# Copyright 2018- The Pixie Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("//bazel:pl_build_system.bzl", "pl_go_test")

go_library(
    name = "live",
    srcs = [
        "autocomplete.go",
        "details.go",
        "ebnf_parser.go",
        "help.go",
        "live.go",
        "new_autocomplete.go",
        "utils.go",
    ],
    importpath = "px.dev/pixie/src/pixie_cli/pkg/live",
    visibility = ["//src:__subpackages__"],
    deps = [
        "//src/api/go/pxapi/utils",
        "//src/api/proto/cloudpb:cloudapi_pl_go_proto",
        "//src/api/proto/vizierpb:vizier_pl_go_proto",
        "//src/pixie_cli/pkg/auth",
        "//src/pixie_cli/pkg/components",
        "//src/pixie_cli/pkg/utils",
        "//src/pixie_cli/pkg/vizier",
        "//src/utils/script",
        "@com_github_alecthomas_chroma//quick",
        "@com_github_alecthomas_participle//:participle",
        "@com_github_alecthomas_participle//lexer",
        "@com_github_alecthomas_participle//lexer/ebnf",
        "@com_github_gdamore_tcell//:tcell",
        "@com_github_gofrs_uuid//:uuid",
        "@com_github_rivo_tview//:tview",
        "@com_github_sahilm_fuzzy//:fuzzy",
    ],
)

pl_go_test(
    name = "live_test",
    srcs = ["ebnf_parser_test.go"],
    deps = [
        ":live",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
    ],
)
